#ifndef _NO_ACE_COMPONENT
#pragma once

#include "ace\Proactor.h"
#include "ace\Win32_Proactor.h"
#include "ace\Thread_Semaphore.h"

namespace XGC
{
	namespace net
	{
		class CProactor : public ACE_Task<ACE_MT_SYNCH>
		{
		public:
			CProactor (void);
			virtual ~CProactor();
			virtual int svc (void);

			int start (int num_threads, size_t max_op = 512 );
			int stop  (void);

		private:
			int  create_proactor ( size_t max_op );
			int  delete_proactor ( void );

			ACE_SYNCH_RECURSIVE_MUTEX lock_;
			ACE_Thread_Semaphore sem_;
			ACE_Proactor * proactor_;
		};
	}
}
#endif